package main

import (
	"strings"
)

func main() {
	s := "dasd 454 sada 454"
	println(strings.Replace(s, " ", "%20", -1))
	println(replaceSpace(s))
}

func replaceSpace(s string) string {
	var res string
	for _, v := range s {
		switch v {
		case ' ':
			res += "%20"
		default:
			res += string(v)
		}
	}
	return res
}
